<?
require("config.php");

$nome     = $_POST['txtNome'];
$cnpj     = $_POST['txtCnpj'];
$listar   = $_POST['listar'];

?>

 <?
 
 if($listar == "ok"){
 
 
 if($nome != ""){
		$sql="select * from clientes where nome like '". $nome ."%'";
	}else{
		$sql="select * from clientes where cnpj = '" .$cnpj."'";
	}
	
	
$execute_sql=mysql_query($sql,$conexao);

while ($campo=mysql_fetch_array($execute_sql)){

  
  ?>
  <tr>
    <td width="165"><? echo $campo['nome'];?></td>
    <td width="180"><? echo $campo['cnpj'];?></td>
    <td><? echo $campo['cidade'];?></td>
    <td>&nbsp;</td>
  </tr>
  
  
  <?
  }
 }
  
  ?>
